The domain of the function $f(x) = \arcsin(\log_{m}(nx))$ is a closed interval of length $\frac{1}{2013}$ , where $m$ and $n$ are positive integers and $m>1$. Find the the smallest possible value of $m+n.$
The function $f(x) = \arcsin (\log_m (nx))$ is defined when
\[-1 \le \log_m (nx) \le 1.\]This is equivalent to
\[\frac{1}{m} \le nx \le m,\]or
\[\frac{1}{mn} \le x \le \frac{m}{n}.\]Thus, the length of the interval is $\frac{m}{n} - \frac{1}{mn} = \frac{m^2 - 1}{mn},$ giving us the equation
\[\frac{m^2 - 1}{mn} = \frac{1}{2013}.\]Hence
\[n = \frac{2013 (m^2 - 1)}{m} = \frac{2013m^2 - 2013}{m}.\]We want to minimize $n + m = \frac{2014m^2 - 2013}{m}.$  It is not hard to prove that this is an increasing function for $m \ge 1;$ thus, we want to find the smallest possible value of $m.$

Because $m$ and $m^2 - 1$ are relatively prime, $m$ must divide 2013.  The prime factorization of 2013 is $3 \cdot 11 \cdot 61.$  The smallest possible value for $m$ is then 3.  For $m = 3,$
\[n = \frac{2013 (3^2 - 1)}{3} = 5368,\]and the smallest possible value of $m + n$ is $\boxed{5371}.$